#!usr/bin/env python  
# -*- coding:utf-8 _*-
""" 
@author:robot
@file: node04_join.py 
@version:
@time: 2022/05/18 
"""
# 03
from TapClientCore.T04_logic.Dag02.node.operate_node.node08_field_rename import FieldRenameNode


class Join(FieldRenameNode):
    def generate_node(self, operations):
        _operations = [{
            "expression": "=",
            "left": "pk",
            "right": "PK"
        }]

        if operations:
            _operations = operations
        node = {
            "attrs": {
                "position": [
                    -300,
                    100
                ]
            },
            "id": self.newId,
            "joinExpressions": _operations,
            "joinType": "left",
            "leftNodeId": "",
            "name": "连接",
            "rightNodeId": "",
            "type": "join_processor",
        }
        self.node = node
